package fr.grassaud.hmvc.test;

import java.util.Set;

import fr.grassaud.hmvc.event.HMVCEvent;
import fr.grassaud.hmvc.session.HMVCSessionImpl;
import fr.grassaud.hmvc.session.HMVCSession;
import fr.grassaud.hmvc.session.TriadListener;

public class MockHMVCSession implements HMVCSession {  
    
    
    private HMVCSessionImpl session; 
    
    public MockHMVCSession() {
           session = new HMVCSessionImpl();	
    }
	

    @Override
    public boolean sendViewEvent(Object sender, HMVCEvent event) {
	boolean result = session.sendViewEvent(sender, event);
	return result;
    }

    @Override
    public boolean sendModelEvent(Object sender, HMVCEvent event) {
	session.sendModelEvent(sender, event);
	return false;
    }
   
    public boolean sendControllerEvent(Object sender, HMVCEvent event) {
	session.sendControllerEvent(sender, event);
	return false;
    }

    @Override
    public <T> T getAttribute(String name) {
	
	return session.getAttribute(name);
    }

    @Override
    public void removeAttribute(String name) {
	session.removeAttribute(name);
	
    }

    @Override
    public Set<String> getAttributeNames() {
	return session.getAttributeNames();
    }

    @Override
    public <T> T getMainView() {
	return session.getMainView();
    }

    @Override
    public Class<?> getRootControllerClass() {
	return session.getRootControllerClass();
    }


    @Override
    public String getId() {
	return session.getId();
    }


    @Override
    public void addTriadListener(TriadListener listener) {
	session.addTriadListener(listener);
	
    }


    @Override
    public void removeTriadListener(TriadListener listener) {
        session.removeTriadListener(listener);	
    }


    @Override
    public void addAttribute(String name, Object object) {
	// TODO Auto-generated method stub
	
    }
    

}
